fix: .ic-assets.json configuration entries no longer overwrite the default for allow_raw_access #3635
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Previously, any configuration element in .ic-assets.json functioned as if a setting of
"allow_raw_access": true
were present in the json object.For example, given the following configuration, all files would be configured
with
allow_raw_access
set totrue
, as if the second entry specified"allow_raw_access": true
(which is the default), even though it does not.Now, given the same configuration, all files would be configured with
allow_raw_access
set to false, as expected.Note that the default value of
allow_raw_access
is stilltrue
.Fixes https://dfinity.atlassian.net/browse/SDK-1238
Notes to reviewers:
true
comes from here: https://github.com/dfinity/sdk/blob/master/src/canisters/frontend/ic-asset/src/asset/config.rs#L228"asset configuration via .ic-assets.json5 - detect unused config"
e2e test was a hint of the problem: the configuration file doesn't specify a value, but it showed up in the output as if it had.How Has This Been Tested?
Added e2e tests, as well as a unit test from #3434
This PR is broken up into two commits. The first adds the tests, two of which fail. The second
Checklist: